<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::create('members', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 30)->notNull()->unique()->comment('用户名');
            $table->string('password');
            $table->tinyInteger('type')->notNull()->default(0)->comment(' 1. 普通会员 2. 讲师 3. 总监 0代表没有分配');
            $table->string('email', 40)->notNull()->unique()->comment('邮箱');
            $table->string('phoneNumber', 20)->notNull()->unique()->comment('手机号');
            $table->string('avatar', 150)->notNull()->default('')->comment('头像');
            $table->tinyInteger('gender')->notNull()->default(0)->comment(' 1. 男 2. 女 0. 保密');
            $table->decimal('money', 10, 2)->notNull()->default(0)->comment('账户余额');
            $table->tinyInteger('education')->notNull()->default(0)->comment(' 1.大专 2. 专科 3. 本科 4. 硕士.... ');
            $table->string('job')->notNull()->default('')->comment('工作经历');

            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('members');
    }
}
